package cn.com.db.service;

import cn.com.db.model.Seller;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class SellerService extends BaseService{

    public void createSeller(Seller seller){
        sellerDao.createSeller(seller);
    }



    public Seller getSellerById(String id){
        return sellerDao.getSellerById(id);
    }

    public List<Seller> getSeller(Integer page,Integer count){
        return sellerDao.getSeller((page-1)*count,count);
    }

    public Integer countSeller(){
        return sellerDao.countSeller();
    }

    public Seller getSellerByAuthingId(String authingId){
        return sellerDao.getSellerByAuthingId(authingId);
    }

    public Integer getSellerNum(){
        return sellerDao.getSellerNum();
    }


    @Transactional
    public void updateSeller(Seller seller){
        sellerDao.update(seller);
    }
}
